/**
 * Tencent is pleased to support the open source community by making Tseer available.
 *
 * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
 * 
 * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * https://opensource.org/licenses/BSD-3-Clause
 *
 * Unless required by applicable law or agreed to in writing, software distributed 
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

// **********************************************************************
// This file was generated by a TARS parser!
// TARS version 1.0.1.
// **********************************************************************

package com.qq.cloud.router.client.share.tseer;

import com.qq.tars.protocol.util.*;
import com.qq.tars.protocol.annotation.*;
import com.qq.tars.protocol.tars.*;
import com.qq.tars.protocol.tars.annotation.*;

@TarsStruct
public class NodeStat {

	@TarsStructProperty(order = 1, isRequire = false)
	public String localIp = "";
	@TarsStructProperty(order = 2, isRequire = false)
	public int timeCost = 0;
	@TarsStructProperty(order = 3, isRequire = false)
	public int ret = 0;
	@TarsStructProperty(order = 4, isRequire = false)
	public String moduleName = "";
	@TarsStructProperty(order = 5, isRequire = false)
	public String ip = "";
	@TarsStructProperty(order = 6, isRequire = false)
	public int port = 0;
	@TarsStructProperty(order = 7, isRequire = false)
	public String obj = "";
	@TarsStructProperty(order = 8, isRequire = false)
	public boolean isTcp = false;
	@TarsStructProperty(order = 9, isRequire = false)
	public String funcName = "";
	@TarsStructProperty(order = 10, isRequire = false)
	public String version = "";
	@TarsStructProperty(order = 11, isRequire = false)
	public int lbType = 0;
	@TarsStructProperty(order = 12, isRequire = false)
	public int getType = 0;
	@TarsStructProperty(order = 13, isRequire = false)
	public String identifier = "";

	public String getLocalIp() {
		return localIp;
	}

	public void setLocalIp(String localIp) {
		this.localIp = localIp;
	}

	public int getTimeCost() {
		return timeCost;
	}

	public void setTimeCost(int timeCost) {
		this.timeCost = timeCost;
	}

	public int getRet() {
		return ret;
	}

	public void setRet(int ret) {
		this.ret = ret;
	}

	public String getModuleName() {
		return moduleName;
	}

	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public int getIPort() {
		return port;
	}

	public void setIPort(int port) {
		this.port = port;
	}

	public String getObj() {
		return obj;
	}

	public void setObj(String obj) {
		this.obj = obj;
	}

	public boolean isTcp() {
		return isTcp;
	}

	public void setTcp(boolean isTcp) {
		this.isTcp = isTcp;
	}

	public String getFuncName() {
		return funcName;
	}

	public void setFuncName(String funcName) {
		this.funcName = funcName;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public int getLbType() {
		return lbType;
	}

	public void setLbType(int lbType) {
		this.lbType = lbType;
	}

	public int getGetType() {
		return getType;
	}

	public void setGetType(int getType) {
		this.getType = getType;
	}

	public String getIdentifier() {
		return identifier;
	}

	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}

	public NodeStat() {
	}

	public NodeStat(String localIp, int timeCost, int ret, String moduleName, String ip, int port, String obj, boolean isTcp, String funcName, String version, int lbType, int getType, String identifier) {
		this.localIp = localIp;
		this.timeCost = timeCost;
		this.ret = ret;
		this.moduleName = moduleName;
		this.ip = ip;
		this.port = port;
		this.obj = obj;
		this.isTcp = isTcp;
		this.funcName = funcName;
		this.version = version;
		this.lbType = lbType;
		this.getType = getType;
		this.identifier = identifier;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + TarsUtil.hashCode(localIp);
		result = prime * result + TarsUtil.hashCode(timeCost);
		result = prime * result + TarsUtil.hashCode(ret);
		result = prime * result + TarsUtil.hashCode(moduleName);
		result = prime * result + TarsUtil.hashCode(ip);
		result = prime * result + TarsUtil.hashCode(port);
		result = prime * result + TarsUtil.hashCode(obj);
		result = prime * result + TarsUtil.hashCode(isTcp);
		result = prime * result + TarsUtil.hashCode(funcName);
		result = prime * result + TarsUtil.hashCode(version);
		result = prime * result + TarsUtil.hashCode(lbType);
		result = prime * result + TarsUtil.hashCode(getType);
		result = prime * result + TarsUtil.hashCode(identifier);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof NodeStat)) {
			return false;
		}
		NodeStat other = (NodeStat) obj;
		return (
			TarsUtil.equals(localIp, other.localIp) &&
			TarsUtil.equals(timeCost, other.timeCost) &&
			TarsUtil.equals(ret, other.ret) &&
			TarsUtil.equals(moduleName, other.moduleName) &&
			TarsUtil.equals(ip, other.ip) &&
			TarsUtil.equals(port, other.port) &&
			TarsUtil.equals(obj, other.obj) &&
			TarsUtil.equals(isTcp, other.isTcp) &&
			TarsUtil.equals(funcName, other.funcName) &&
			TarsUtil.equals(version, other.version) &&
			TarsUtil.equals(lbType, other.lbType) &&
			TarsUtil.equals(getType, other.getType) &&
			TarsUtil.equals(identifier, other.identifier) 
		);
	}

	public void writeTo(TarsOutputStream _os) {
		if (null != localIp) {
			_os.write(localIp, 1);
		}
		_os.write(timeCost, 2);
		_os.write(ret, 3);
		if (null != moduleName) {
			_os.write(moduleName, 4);
		}
		if (null != ip) {
			_os.write(ip, 5);
		}
		_os.write(port, 6);
		if (null != obj) {
			_os.write(obj, 7);
		}
		_os.write(isTcp, 8);
		if (null != funcName) {
			_os.write(funcName, 9);
		}
		if (null != version) {
			_os.write(version, 10);
		}
		_os.write(lbType, 11);
		_os.write(getType, 12);
		if (null != identifier) {
			_os.write(identifier, 13);
		}
	}


	public void readFrom(TarsInputStream _is) {
		this.localIp = _is.readString(1, false);
		this.timeCost = _is.read(timeCost, 2, false);
		this.ret = _is.read(ret, 3, false);
		this.moduleName = _is.readString(4, false);
		this.ip = _is.readString(5, false);
		this.port = _is.read(port, 6, false);
		this.obj = _is.readString(7, false);
		this.isTcp = _is.read(isTcp, 8, false);
		this.funcName = _is.readString(9, false);
		this.version = _is.readString(10, false);
		this.lbType = _is.read(lbType, 11, false);
		this.getType = _is.read(getType, 12, false);
		this.identifier = _is.readString(13, false);
	}

}
